export default {
    obj2search (obj:object):string {
        var str:string = ''
        for (let key in obj) {
            str += '&' + key + '=' + obj[key]
        }
        return str.slice(1)
    },
    search2obj (str: string):object {
        var obj:object = {}
        str.split('&').forEach(item=>{
            var [key,value] = item.split('=')
            obj[key] = value
        })
        return obj
    },
}